/**
 * Created by Baggio on 2018-4-25.
 */
$(function () {
    $("#submit").click(function () {
        var postData=$('#form-member-add').serialize();
        $("#form-member-add").ajaxSubmit({
            cache: true,
            type: 'POST',
            data: postData,
            url: '/admin/media/modifyMedia.html',
            async: false,
            success: function (res) {
                var data=JSON.parse(res); //将JSON对象转化为JSON字符
                console.log(data);
                if(data.code!=1){
                    layer.msg(data.msg, {icon: 5, time: 1000});
                    return;
                }
               alert("添加成功！");
            }
        })
    });
});